cmake_minimum_required(VERSION 2.8.4)

SET(PRJ_NAME 				linuxprobe)
SET(SVC_ROUTINE				osprobe)
SET(PRJ_ROOTDIR				${CMAKE_CURRENT_SOURCE_DIR} )
SET(SMTPLIB_ROOTDIR			${CMAKE_CURRENT_SOURCE_DIR}/smtp-client )

PROJECT(${PRJ_NAME} 		C CXX)

MESSAGE(STATUS "Building linux OS probe service routine.")
	
INCLUDE_DIRECTORIES( 
	"${PRJ_ROOTDIR}"
	"${SMTPLIB_ROOTDIR}/src"
)

LINK_DIRECTORIES(
	"${PRJ_ROOTDIR}/build"
)
	
	SET(cflags	-std=gnu99)
	ADD_DEFINITIONS(${cflags})

	SET(SRCLIST_${SVC_ROUTINE}
		${PRJ_ROOTDIR}/cJSON.c
		${PRJ_ROOTDIR}/os.c
		${PRJ_ROOTDIR}/os_disk.c
		#${PRJ_ROOTDIR}/os_session.c
		${SMTPLIB_ROOTDIR}/src/smtp.c
		${PRJ_ROOTDIR}/osprobe.c
	)

	ADD_EXECUTABLE(${SVC_ROUTINE}  ${SRCLIST_${SVC_ROUTINE}} )
	TARGET_LINK_LIBRARIES(${SVC_ROUTINE} -ldl -lm -lpthread)